import torch
import torch.nn.functional as F

torch.manual_seed(42)

input_tensor = torch.rand(2, 9) * 10 - 5
print("input_tensor =", input_tensor)

# ReLU激活
output = F.relu(input_tensor)
print("ReLU =", output)

# Sigmoid激活
output = torch.sigmoid(input_tensor)
print("Sigmoid =", output)

# Tanh激活
output = F.tanh(input_tensor)
print("Tanh =", output)